package cn.iocoder.yudao.module.api.brokerage.record.dto;

import cn.iocoder.yudao.framework.validation.InEnumCode;
import cn.iocoder.yudao.framework.validation.InEnumValue;
import cn.iocoder.yudao.framework.validation.Percent;
import cn.iocoder.yudao.module.api.brokerage.record.enums.BrokerageBonusLevelEnum;
import cn.iocoder.yudao.module.api.brokerage.record.enums.BrokerageRecordBizTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 分佣记录 Request DTO
 *
 * @author owen
 */
@Data
@NoArgsConstructor
public class BrokerageRecordSaveDTO {

    @Schema(description = "业务类型：buy_product、buy_vip", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "业务类型不能为空")
    @InEnumCode(BrokerageRecordBizTypeEnum.class)
    private String bizType;

    @Schema(description = "业务编号，如交易单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "业务编号不能为空")
    private String bizId;

    @Schema(description = "分佣级别：1-一级、2-二级", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "分佣级别不能为空")
    @InEnumValue(BrokerageBonusLevelEnum.class)
    private Integer bonusLevel;

    @Schema(description = "分佣比例", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "分佣比例不能为空")
    @Percent
    private Double bonusPercent;

    @Schema(description = "来源用户编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "来源用户编号不能为空")
    private Long sourceUserId;

    @Schema(description = "分佣基准金额，单位为分", requiredMode = Schema.RequiredMode.REQUIRED)
    @NotNull(message = "分佣基准金额不能为空")
    private Integer basePrice;

    @Schema(description = "备注")
    private String note;

}
